package io.xxx.xbutler.sdk.request;

import com.alibaba.fastjson2.annotation.JSONField;
import io.xxx.xbutler.sdk.TanJingRequest;
import io.xxx.xbutler.sdk.response.TrusteeshipApplyResponse;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Map;

/**
 * 商家机器人账号密码托管登录接口
 */
@Data
@Accessors(chain = true)
public class TrusteeshipApplyRequest implements TanJingRequest<TrusteeshipApplyResponse> {

    /**
     * 城市编码
     */
    @JSONField(name = "city_no")
    private String cityNo;

    /**
     * 透传参数
     */
    @JSONField(name = "extend")
    private String extend;

    /**
     * 微信账号
     */
    @JSONField(name = "wx_account")
    private String wxAccount;

    /**
     * 微信密码
     */
    @JSONField(name = "wx_password")
    private String wxPassword;

    /**
     * 2：IPHONE协议
     * 4：Android协议
     */
    @JSONField(name = "protocol_type")
    private Integer protocolType;

    /**
     * 授权方式
     * 1 - 二维码扫码确认
     * 2 - 短信确认
     * 3 - 客户端授权确认
     * 4 - 授权海外登录
     */
    @JSONField(name = "confirm_way")
    private Integer confirmWay;

    @Override
    public String path() {
        return "/scrm/robot/trusteeship-apply";
    }

    @Override
    public Map<String, Object> params() {
        return Map.of(
                "city_no", cityNo,
                "extend", extend,
                "wx_account", wxAccount,
                "wx_password", wxPassword,
                "protocol_type", protocolType,
                "confirm_way", confirmWay
        );
    }

    @Override
    public Class<TrusteeshipApplyResponse> responseType() {
        return TrusteeshipApplyResponse.class;
    }

    @Override
    public String merchantName() {
        return "merchant_no";
    }
}
